﻿namespace MefContrib.Models.Provider.Definitions.Configurable
{
    using System.Configuration;
    using System.Diagnostics;

    /// <summary>
    /// 
    /// </summary>
    public class PartCatalogConfigurationPart : ConfigurationElement
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PartCatalogConfigurationPart"/> class.
        /// </summary>
        public PartCatalogConfigurationPart()
        {
        }

        /// <summary>
        /// Gets a collection of all the exports defined for the <see cref="PartCatalogConfigurationPart"/>.
        /// </summary>
        /// <value>A <see cref="PartCatalogConfigurationExportCollection"/> object.</value>
        [ConfigurationProperty("exports", IsDefaultCollection = false, IsRequired = false)]
        public PartCatalogConfigurationExportCollection Exports
        {
            [DebuggerStepThrough]
            get { return (PartCatalogConfigurationExportCollection)base["exports"]; }
        }

        /// <summary>
        /// Gets a collection of all the imports defined for the <see cref="PartCatalogConfigurationPart"/>.
        /// </summary>
        /// <value>A <see cref="PartCatalogConfigurationImportCollection"/> object.</value>
        [ConfigurationProperty("imports", IsDefaultCollection = false, IsRequired = false)]
        public PartCatalogConfigurationImportCollection Imports
        {
            [DebuggerStepThrough]
            get { return (PartCatalogConfigurationImportCollection)base["imports"]; }
        }

        /// <summary>
        /// Gets or sets the name of the type.
        /// </summary>
        /// <value>A string containing the name of the type.</value>
        [ConfigurationProperty("type", IsRequired = true),
            StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\")]
        public string Type
        {
            [DebuggerStepThrough]
            get { return this["type"] as string; }
            [DebuggerStepThrough]
            set { this["type"] = value; }
        }
    }
}